#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <string>

using namespace std;

#include <iostream>
#include <vector>
using namespace std;
int num = 2;
void step_num(int right, int down, int n, int m)
{
	if (right < n && down < m)
	{
		num += 1;
		step_num(right + 1, down, n, m);
		step_num(right, down + 1, n, m);
	}
}
int main()
{
	int n, m;
	cin >> n >> m;
	int right = 0;
	int down = 0;
	step_num(right + 1, down, n, m);
	step_num(right, down + 1, n, m);
	cout << num;
	return 0;
}


void Test()
{
	/*string s1("hello");
	cout << s1.size();*/

	const int a = 10;
	int* p = (int*)(&a);
	*p = 20;
	cout << p << " " << &a << endl;
	cout << *p << " " << a << endl;
	const int b = a;
	cout << b << endl;
}

//int main()
//{
//	Test();
//	return 0;
//}